.peri {
    position: relative;
    z-index: 19891014;
}

.peri * {
    box-sizing: border-box;
}

.peri-main, .peri-shade {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.peri-shade {
    background-color: rgba(0,0,0,0.35);
    backdrop-filter: blur(3px);
    pointer-events: auto;
}

.peri-main {
    display: table;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    pointer-events: none;
}

.peri-section {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    padding: 0 16px;
}

.peri-child {
    position: relative;
    display: inline-block;
    background: linear-gradient(to bottom, var(--peri-gradient-start), var(--peri-bg));
    border-radius: 16px;
    box-shadow: var(--peri-shadow);
    pointer-events: auto;
    animation-fill-mode: both;
    animation-duration: .25s;
    width: 90%;
    max-width: 420px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* يانفۇن ئۈچۈن ئالاھىدە تەڭشەكلەر */
@media screen and (max-width: 767px) {
    .peri-section {
        padding: 0; /* پادىچەكنى ئېلىۋېتىش */
    }
    
    .peri-child {
        width: 90%; /* كەڭلىكنى تەڭشەش */
        margin: 0 auto; /* ئوتتۇرىغا توغرىلاش */
        border-radius: 10px;
    }

    .peri-child h3 {
        padding: 16px 20px;
        font-size: 16px;
    }

    .peri-content {
        padding: 20px;
        font-size: 14px;
    }

    .peri-btn {
        padding: 8px 12px 12px;
        gap: 6px;
    }
    
    .peri-btn span {
        padding: 10px 0;
        font-size: 14px;
        border-radius: 6px;
    }
}

/* ئانىماتسىيە */
@keyframes peri-anim-scale {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* يانفۇن ئۈچۈن تۆۋەندىن چىقىش ئانىماتسىيەسى */
@keyframes peri-anim-up {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.peri-anim-scale {
    animation-name: peri-anim-scale;
}

/* يانفۇندا تۆۋەندىن چىقىش ئانىماتسىيەسىنى ئىشلىتىش */
@media screen and (max-width: 767px) {
    .peri-anim-scale {
        animation-name: peri-anim-up;
    }
}

/* ماۋزۇ */
.peri-child h3 {
    margin: 0;
    padding: 20px 24px;
    font-size: 17px;
    font-weight: 500;
    color: var(--peri-title);
    background: linear-gradient(to right, var(--peri-title-gradient-start), var(--peri-title-gradient-end));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid var(--peri-border);
}

/* مەزمۇن */
.peri-content {
    padding: 28px 24px;
    line-height: 1.6;
    font-size: 15px;
    color: var(--peri-content);
}

/* كۇنۇپكا تەڭشەكلىرى */
.peri-btn {
    display: flex;
    gap: 10px;
    padding: 12px 20px 20px;
}

.peri-btn span {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    border-radius: 12px;
    border: none;
}

.peri-btn span[yes] {
    color: var(--peri-primary-text);
    background: linear-gradient(135deg, var(--peri-primary), var(--peri-primary-gradient));
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.35);
}

.peri-btn span[no] {
    color: var(--peri-secondary-text);
    background: var(--peri-secondary);
    border: 1px solid var(--peri-border);
}

/* RTL تەڭشەكلىرى */
.peri[dir="rtl"] {
    direction: rtl;
}

.peri[dir="rtl"] .peri-child {
    text-align: right;
}

.peri[dir="rtl"] .peri-content {
    text-align: right;
}

/* LTR تەڭشەكلىرى */
.peri[dir="ltr"] {
    direction: ltr;
}

.peri[dir="ltr"] .peri-child {
    text-align: left;
}

.peri[dir="ltr"] .peri-content {
    text-align: left;
}

/* يانفۇن ئۈچۈن كۇنۇپكا تەڭشەكلىرى */
@media screen and (max-width: 767px) {
    .peri-btn {
        padding: 8px 12px 12px;
        gap: 6px;
    }
    
    .peri-btn span {
        padding: 10px 0;
        font-size: 14px;
        border-radius: 6px;
    }
}

/* hover ھالەتلىرى */
.peri-btn span[yes]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(24, 144, 255, 0.45);
}

.peri-btn span[no]:hover {
    background: color-mix(in srgb, var(--peri-secondary) 95%, white);
}

/* يېڭى ئانىماتسىيە ئۈنۈملىرى */
@keyframes peri-anim-bounce {
    0% { 
        opacity: 0;
        transform: scale(0.3);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.05);
    }
    70% { 
        transform: scale(0.9);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes peri-anim-fade {
    0% { 
        opacity: 0;
    }
    100% { 
        opacity: 1;
    }
}

@keyframes peri-anim-slide-top {
    0% { 
        opacity: 0;
        transform: translateY(-100px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes peri-anim-slide-bottom {
    0% { 
        opacity: 0;
        transform: translateY(100px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes peri-anim-flip {
    0% { 
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    100% { 
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

/* ئانىماتسىيە كىلاسلىرى */
.peri-anim-bounce {
    animation-name: peri-anim-bounce;
    animation-duration: 0.5s;
}

.peri-anim-fade {
    animation-name: peri-anim-fade;
    animation-duration: 0.3s;
}

.peri-anim-slide-top {
    animation-name: peri-anim-slide-top;
    animation-duration: 0.3s;
}

.peri-anim-slide-bottom {
    animation-name: peri-anim-slide-bottom;
    animation-duration: 0.3s;
}

.peri-anim-flip {
    animation-name: peri-anim-flip;
    animation-duration: 0.4s;
}

/* يېڭى ئۇسلۇبلار */
/* Toast ئۇسلۇبى */
.peri-toast {
    min-width: auto !important;
    max-width: 90% !important;
    width: auto !important;
    background: rgba(0,0,0,0.8) !important;
    color: #fff !important;
    padding: 12px 25px;
    border-radius: 25px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.peri-toast .peri-content {
    color: #fff !important;
    padding: 0 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

.peri-toast[dir="rtl"] .peri-content {
    text-align: right !important;
}

.peri-toast[dir="ltr"] .peri-content {
    text-align: left !important;
}

/* يۈكلەش ھالىتى ئۇسلۇبى */
.peri-loading {
    background: transparent !important;
    box-shadow: none !important;
}

.peri-loading .peri-child {
    background: transparent !important;
    box-shadow: none !important;
    width: auto !important;
    display: inline-block !important;
}

.peri-loading .peri-content {
    padding: 20px !important;
    color: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

.peri-loading[dir="rtl"] .peri-content::after {
    text-align: right !important;
}

.peri-loading[dir="ltr"] .peri-content::after {
    text-align: left !important;
}

.peri-loading i {
    display: inline-block;
    width: 35px;
    height: 35px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: peri-loading 1s infinite linear;
}

/* يۈكلەش ئانىماتسىيەسى */
@keyframes peri-loading {
    to { transform: rotate(360deg); }
}

/* يۈكلەش ھالىتىدىكى تېكىست */
.peri-loading .peri-content::after {
    content: attr(data-text);
    color: #fff;
    font-size: 14px;
}

/* سۈرەت كۆرسىتىش ئۇسلۇبى */
.peri-photo {
    background: transparent !important;
    box-shadow: none !important;
}

.peri-photo img {
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
}

/* تېما تەڭشەكلىرى */
.peri-child {
    --peri-gradient-start: color-mix(in srgb, var(--peri-bg) 85%, white);
    --peri-title-gradient-start: var(--peri-title);
    --peri-title-gradient-end: color-mix(in srgb, var(--peri-title) 80%, var(--peri-primary));
    --peri-primary-gradient: color-mix(in srgb, var(--peri-primary) 80%, #40a9ff);
}

/* كۇنۇپكا hover ھالىتى */
.peri-btn span[yes]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(24, 144, 255, 0.45);
}

.peri-btn span[no]:hover {
    background: color-mix(in srgb, var(--peri-secondary) 95%, white);
}

/* يورۇق تېما */
.peri-child[style*="light"] {
    --peri-gradient-start: #ffffff;
    --peri-bg: #fafafa;
}

/* قاراڭغۇ تېما */
.peri-child[style*="dark"] {
    --peri-gradient-start: #2d2d2d;
    --peri-bg: #1f1f1f;
}

/* سايە تەڭشەكلىرى */
.peri-shade {
    background-color: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
}
